<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="../../layout/template.xhtml">

	<ui:define name="body">
		<fieldset>
			<legend>Relatório de pendências</legend>
			<h:form id="form" styleClass="form-horizontal" prependId="false">
				<rich:dataTable id="datatable" value="#{colecaoPendencias}"
					var="pendencia" styleClass="table table-hover"
					rows="#{relatorioPendenciasAction.quantidadePorPagina}">
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Software" />
						</f:facet>
						<h:outputText value="#{pendencia.nomeSoftware}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Etapa" />
						</f:facet>
						<h:outputText value="#{pendencia.nomeEtapa}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Versão" />
						</f:facet>
						<h:outputText value="#{pendencia.numeroVersao}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Data Inicial Prevista" />
						</f:facet>
						<h:outputText value="#{pendencia.dataInicialPrevista}">
							<f:convertDateTime pattern="dd/MM/yyyy" />
						</h:outputText>
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="Data Final Prevista" />
						</f:facet>
						<h:outputText value="#{pendencia.dataFinalPrevista}">
							<f:convertDateTime pattern="dd/MM/yyyy" />
						</h:outputText>
					</rich:column>
				</rich:dataTable>
				<center>
					<rich:datascroller id="scroller" for="datatable"
						renderIfSinglePage="false" />
				</center>
				<div style="float: left">
					<p>Total de registros: #{colecaoPendencias.size()}</p>
				</div>
				<div style="float: right">
					<p>
						Registro p/ Página:
						<h:selectOneMenu id="registroPorPagina"
							value="#{relatorioPendenciasAction.quantidadePorPagina}"
							style="margin-top:2px;margin-left:3px">
							<f:selectItem itemLabel="5" itemValue="5"
								noSelectionOption="true" />
							<f:selectItem itemLabel="10" itemValue="10" />
							<f:selectItem itemLabel="15" itemValue="15" />
							<f:selectItem itemLabel="20" itemValue="20" />
							<f:selectItem itemLabel="50" itemValue="50" />
							<a4j:support event="onchange"
								reRender="scroller,registroPorPagina,datatable"
								ajaxSingle="true" />
						</h:selectOneMenu>
					</p>
				</div>
				
				<br></br>
				<br></br>
				<br></br>
				
				<center>
					<h:commandButton
						action="#{relatorioPendenciasAction.imprimirRelatorio()}"
						value="Imprimir relatórios" />
				</center>
			</h:form>
		</fieldset>
	</ui:define>
</ui:composition>
